﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyWebServer
{
    public class JieSuan
    {
        public RoomType roomType;

        public bool isjifen = false;


        /// <summary>
        /// 计算胡牌时的金币数
        /// </summary>
        /// <param name="roomType"></param>
        /// <param name="hplx"></param>
        /// <param name="difen"></param>
        /// <returns></returns>
        public int GetHuScore(RoomType roomType, Hupaileixing hplx, int difen)
        {
            switch (roomType)
            {
                case RoomType.tongyong:
                    switch (hplx)
                    {
                        case Hupaileixing.buhu:
                            return difen * 0;

                        case Hupaileixing.pinhu:
                            return difen * 1;

                        case Hupaileixing.xiaoqidui:
                            return difen * 4;
                        case Hupaileixing.hunyise:
                            return difen * 2;
                        case Hupaileixing.qingyise:
                            return difen * 4;
                        case Hupaileixing.daduizi:
                            return difen * 2;
                        case Hupaileixing.dasanyuan:
                            return difen * 4;
                        case Hupaileixing.hunyise_daduizi:
                            return difen * 4;
                        case Hupaileixing.hunyise_dasanyuan:
                            return difen * 4;
                        case Hupaileixing.hunyise_xiaoqidui:
                            return difen * 4;
                        case Hupaileixing.qingyise_daduizi:
                            return difen * 4;
                        case Hupaileixing.qingyise_dasanyuan:
                            return difen * 4;
                        case Hupaileixing.qingyise_xiaoqidui:
                            return difen * 4;
                        case Hupaileixing.daduizi_dasanyuan:
                            return difen * 4;
                        case Hupaileixing.gsp_pinhu:
                            return difen * 2;
                        case Hupaileixing.gsp_xiaoqidui:
                            return difen * 4;
                        case Hupaileixing.gsp_hunyise:
                            return difen * 4;
                        case Hupaileixing.gsp_qingyise:
                            return difen * 4;
                        case Hupaileixing.gsp_daduizi:
                            return difen * 4;
                        case Hupaileixing.gsp_dasanyuan:
                            return difen * 4;
                        case Hupaileixing.gsp_hunyise_daduizi:
                            return difen * 4;
                        case Hupaileixing.gsp_hunyise_dasanyuan:
                            return difen * 4;
                        case Hupaileixing.gsp_hunyise_xiaoqidui:
                            return difen * 4;
                        case Hupaileixing.gsp_qingyise_daduizi:
                            return difen * 4;
                        case Hupaileixing.gsp_qingyise_dasanyuan:
                            return difen * 4;
                        case Hupaileixing.gsp_qingyise_xiaoqidui:
                            return difen * 4;
                        case Hupaileixing.gsp_daduizi_dasanyuan:
                            return difen * 4;

                    }
                    break;

                case RoomType.xuezhan:
                    break;
                default:
                    break;
            }
            return 0;
        }




        public int GetZiMoScore(RoomType roomType, ZiMoLeixing zmlx, int difen)
        {
            switch (roomType)
            {
                case RoomType.tongyong:
                    switch (zmlx)
                    {
                        case ZiMoLeixing.buzimo:
                            return 0;

                        case ZiMoLeixing.zimo:
                            return difen * 1;

                        case ZiMoLeixing.xiaoqidui:
                            return difen * 4;

                        case ZiMoLeixing.hunyise:
                            return difen * 2;

                        case ZiMoLeixing.qingyise:
                            return difen * 4;

                        case ZiMoLeixing.daduizi:
                            return difen * 2;

                        case ZiMoLeixing.dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.hunyise_daduizi:
                            return difen * 4;

                        case ZiMoLeixing.hunyise_dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.hunyise_xiaoqidui:
                            return difen * 4;

                        case ZiMoLeixing.qingyise_daduizi:
                            return difen * 4;

                        case ZiMoLeixing.qingyise_dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.qingyise_xiaoqidui:
                            return difen * 4;

                        case ZiMoLeixing.daduizi_dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.mq_zimo:
                            return difen * 2;

                        case ZiMoLeixing.mq_hunyise:
                            return difen * 4;

                        case ZiMoLeixing.mq_qingyise:
                            return difen * 4;

                        case ZiMoLeixing.mq_daduizi:
                            return difen * 4;

                        case ZiMoLeixing.mq_dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.mq_hunyise_daduizi:
                            return difen * 4;

                        case ZiMoLeixing.mq_hunyise_dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.mq_hunyise_xiaoqidui:
                            return difen * 4;

                        case ZiMoLeixing.mq_qingyise_daduizi:
                            return difen * 4;

                        case ZiMoLeixing.mq_qingyise_dasanyuan:
                            return difen * 4;

                        case ZiMoLeixing.mq_qingyise_xiaoqidui:
                            return difen * 4;

                        case ZiMoLeixing.mq_daduizi_dasanyuan:
                            return difen * 4;

                        default:
                            break;

                    }
                    break;

                case RoomType.xuezhan:
                    break;
                default:
                    break;
            }
            return 0;
        }


        public int GetShangHuaScore(RoomType roomType, ShangHuaLeiXing shlx, int difen)
        {
            switch (roomType)
            {
                case RoomType.tongyong:
                    switch (shlx)
                    {
                        case ShangHuaLeiXing.bushanghua:
                            return 0;

                        case ShangHuaLeiXing.gangshanghua:
                            return difen * 2;
                        case ShangHuaLeiXing.hunyise_hua:
                            return difen * 4;

                        case ShangHuaLeiXing.dadui_hua:
                            return difen * 4;

                        case ShangHuaLeiXing.qingyise_hua:
                            return difen * 4;

                        case ShangHuaLeiXing.dasanyuan_hua:
                            return difen * 4;

                        case ShangHuaLeiXing.hunyise_dadui_hua:
                            return difen * 4;

                        case ShangHuaLeiXing.hunyise_dasanyuan_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.qingyise_dadui_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.qingyise_dasanyuan_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.dadui_dasanyuan_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_gangshanghua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_hunyise_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_dadui_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_qingyise_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_dasanyuan_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_hunyise_dadui_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_hunyise_dasanyuan_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_qingyise_dadui_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_qingyise_dasanyuan_hua:
                            return difen * 4;
                        case ShangHuaLeiXing.mq_dadui_dasanyuan_hua:
                            return difen * 4;
                        default:
                            break;
                    }
                    break;

                case RoomType.xuezhan:
                    break;
                default:
                    break;
            }
            return 0;
        }
    }
}
